#ifndef USERINTERFACE_H
#define USERINTERFACE_H

#include <QWidget>
#include <QTcpSocket>
#include "pack.h"
#include "udproom.h"
#include <QMessageBox>
#include <QListWidgetItem>

namespace Ui {
class UserInterface;
}

class UserInterface : public QWidget
{
    Q_OBJECT

public:
    explicit UserInterface(QTcpSocket* client, const QString& user_name);
    ~UserInterface();
    void setCreateRoomId(const QString& create_room_id);
    void createRoom(QTcpSocket* client, const QString& user_name, const QString& create_room_id);
    void joinRoom(QTcpSocket* client, const QString& user_name, const QString& owner_name, const QString& join_room_id);

private slots:
    void on_pushButton_2_clicked();

    void on_pushButton_clicked();

    void on_listWidget_itemClicked(QListWidgetItem *item);

private:
    Ui::UserInterface *ui;
    QTcpSocket* client;
    QString user_name;
    QString create_room_id;
    UdpRoom* udp_room;
    QString selected_room_id;
};

#endif // USERINTERFACE_H
